package com.example.bms.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.bms.vo.AnswerVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


/**
 * @apiNote 查询所有的题库
 * @author
 * @email 2837136899@qq.com
 * @since 1.0.0
 */
@Mapper
public interface AnswerMapper {
    /**
     * @apiNote  查询题库信息
     * @author
     * - question: 问题
     * - subject: 科目
     * - score: 分数
     * - section: 七层协议所在层级（例如应用层，数据链路层）
     * - level：考核难度（3个层级）1,2,3
     * @param page 分页的页数
     * @email 2837136899@qq.com
     * @return IPage<AnswerVO>
     * @since 1.0.0
     */
    @Select("select question, subject, score, section,level, \"选择题\" as type from multi_question " +
            "union select  question, subject, score, section,level, \"判断题\" as type  from judge_question " +
            "union select  question, subject, score, section,level, \"填空题\" as type from fill_question")
    IPage<AnswerVO> findAll(Page page);
}
